<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/css/jpetstore.css" type="text/css">
</head>
<body>
    <!--头部引用-->
    <div th:replace="/common/IncludeTop::header"></div>

    <div id="BackLink">
        <a href="/catalog/viewProduct?productId=${sessionScope.product.productId}">Return to ${sessionScope.product.productId}</a>
    </div>

    <div id="Catalog">

        <table>
            <tr>
                <td th:text="${product.description}">${sessionScope.product.description}</td>
            </tr>
            <tr>
                <td th:text="${item.itemId}"><b> ${sessionScope.item.itemId} </b></td>
            </tr>
            <tr>
                <!--这里需要改-->
                <td><b><font size="4"> ${sessionScope.item.attribute1}
                    ${sessionScope.item.attribute2} ${sessionScope.item.attribute3}
                    ${sessionScope.item.attribute4} ${sessionScope.item.attribute5}
                    ${sessionScope.product.name} </font></b></td>
            </tr>
            <tr>
                <td th:text="${product.name}">产品名称</td>
            </tr>
            <tr>
                <td th:if="${item.quantity} le 0">
                    Back ordered.
                </td>
                <td th:if="${item.quantity} gt 0" th:text="${item.quantity}+'in stock'">
                    item的数量in stock.
                </td>
            </tr>
            <tr>
                <!--格式化数字-->
                <td th:text="'$'+${#numbers.formatDecimal(item.listPrice,1,2)}"></td>
            </tr>
            <!--<tr>
                <td>
                    <c:if test="${sessionScope.item.quantity <= 0}">
                        Back ordered.
                    </c:if>
                    <c:if test="${sessionScope.item.quantity > 0}">
                        ${sessionScope.item.quantity} in stock.
                    </c:if></td>
            </tr>-->
            <!--<tr>
                <td><fmt:formatNumber value="${sessionScope.item.listPrice}"
                                      pattern="$#,##0.00" /></td>
            </tr>-->
            <tr>
                <td>
                    <a th:href="@{#(workingItemId=${item.itemId})}">Add to Cart</a>
                </td>
            </tr>

            <!--<tr>
                <td>
                    <a class="Button" href="addItemToCart?workingItemId=${sessionScope.item.itemId}">Add to Cart</a>
                </td>
            </tr>-->
        </table>

    </div>

    <!--底部引用-->
    <div th:replace="/common/IncludeBottom::footer"></div>

</body>
</html>